Filling a DataSet or a DataTable from a LINQ query result set C#

55

Filling a DataSet or a DataTable from a LINQ query result set C# -

IEnumerable<DataRow> query =
    from order in orders.AsEnumerable()
    where order.Field<DateTime>("OrderDate") > new DateTime(2001, 8, 1)
    select order;

// Create a table from the query.
DataTable boundTable = query.CopyToDataTable<DataRow>();

Comments

Submit
0 Comments